# -*- coding: utf-8 -*-
__author__ = 'ggcall'
from npedi import sa


def set_none(v):
    return None if v == '' else v


def set_zero(v):
    return 0 if v == '' else v


class Auth(sa.Model):
    __tablename__ = 'auth'
    id = sa.Column(sa.Text, primary_key=True)
    site = sa.Column(sa.Text)
    cookie = sa.Column(sa.Text)
    tick = sa.Column(sa.Text)
    refresh = sa.Column(sa.Text)


class CusMov(sa.Model):
    __tablename__ = 'cusmov'
    id = sa.Column(sa.Integer, primary_key=True)
    vessel = sa.Column(sa.Text)
    voyage = sa.Column(sa.Integer)
    boxno = sa.Column(sa.Text)
    pier = sa.Column(sa.Text)
    boxsize = sa.Column(sa.Text)
    movtype = sa.Column(sa.Text)
    h986 = sa.Column(sa.Text)
    destplace = sa.Column(sa.Integer)
    movflag = sa.Column(sa.Text)
    instructtime = sa.Column(sa.Text)
    dealtime = sa.Column(sa.Text)
    feedback = sa.Column(sa.Text)
